<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<meta name="keywords" content="Cluster,deployment" />
	<meta name="description" content="Cluster deployment instructions" />
	<!-- 网页标签标题 -->
	<title>Cluster deployment instructions</title>
	<link rel="shortcut icon" href="https://img.alicdn.com/tfs/TB1hgJpHAPoK1RjSZKbXXX1IXXa-64-64.png"/>
	<link rel="stylesheet" href="/build/documentation.css" />
</head>
<body>
	<div id="root"><div class="documentation-page" data-reactroot="" data-reactid="1" data-react-checksum="1867728636"><header class="header-container header-container-normal" data-reactid="2"><div class="header-body" data-reactid="3"><a href="/en-us/index.html" data-reactid="4"><img class="logo" src="/img/nacos_colorful.png" data-reactid="5"/></a><div class="search search-normal" data-reactid="6"><span class="icon-search" data-reactid="7"></span></div><span class="language-switch language-switch-normal" data-reactid="8">中</span><div class="header-menu" data-reactid="9"><img class="header-menu-toggle" src="/img/menu_gray.png" data-reactid="10"/><ul data-reactid="11"><li class="menu-item menu-item-normal" data-reactid="12"><a href="/en-us/index.html" data-reactid="13">HOME</a></li><li class="menu-item menu-item-normal menu-item-normal-active" data-reactid="14"><a href="/en-us/docs/quick-start.html" data-reactid="15">DOCS</a></li><li class="menu-item menu-item-normal" data-reactid="16"><a href="/en-us/blog" data-reactid="17">BLOG</a></li><li class="menu-item menu-item-normal" data-reactid="18"><a href="/en-us/community" data-reactid="19">COMMUNITY</a></li><li class="menu-item menu-item-normal" data-reactid="20"><a href="https://cn.aliyun.com/product/aliware/mse?spm=nacos-website.topbar.0.0.0" data-reactid="21">NACOS IN CLOUD</a><img class="menu-img" src="https://img.alicdn.com/tfs/TB1esl_m.T1gK0jSZFrXXcNCXXa-200-200.png" data-reactid="22"/></li><li class="menu-item menu-item-normal" data-reactid="23"><a href="https://job.alibaba.com/zhaopin/position_detail.htm?trace=qrcode_share&amp;positionCode=GP633620" data-reactid="24">HIRING</a><img class="menu-img" src="https://img.alicdn.com/tfs/TB1esl_m.T1gK0jSZFrXXcNCXXa-200-200.png" data-reactid="25"/></li><li class="menu-item menu-item-normal" data-reactid="26"><a href="http://console.nacos.io/nacos/index.html" data-reactid="27">DEMO-CONSOLE</a></li></ul></div></div></header><div class="bar" data-reactid="28"><div class="bar-body" data-reactid="29"><img src="/img/docs.png" class="front-img" data-reactid="30"/><div class="bar-title" data-reactid="31"><span data-reactid="32">Documentation</span><div class="bone bone-light" data-reactid="33"></div></div><img src="/img/docs.png" class="back-img" data-reactid="34"/></div></div><section class="content-section" data-reactid="35"><div class="content-body" data-reactid="36"><div class="sidemenu" data-reactid="37"><div class="sidemenu-toggle" data-reactid="38"><img src="https://img.alicdn.com/tfs/TB1E6apXHGYBuNjy0FoXXciBFXa-200-200.png" data-reactid="39"/></div><ul data-reactid="40"><li class="menu-item menu-item-level-1" data-reactid="41"><span data-reactid="42">Nacos </span><ul data-reactid="43"><li style="height:180px;overflow:hidden;" class="menu-item menu-item-level-2" data-reactid="44"><span data-reactid="45"><!-- react-text: 46 -->What is Nacos<!-- /react-text --><img style="transform:rotate(0deg);" class="menu-toggle" src="/img/arrow_down.png" data-reactid="47"/></span><ul data-reactid="48"><li class="menu-item menu-item-level-3" data-reactid="49"><a href="/en-us/docs/what-is-nacos.html" target="_self" data-reactid="50">What is Nacos</a></li><li class="menu-item menu-item-level-3" data-reactid="51"><a href="/en-us/docs/concepts.html" target="_self" data-reactid="52">Concepts</a></li><li class="menu-item menu-item-level-3" data-reactid="53"><a href="/en-us/docs/architecture.html" target="_self" data-reactid="54">Architecure</a></li><li class="menu-item menu-item-level-3" data-reactid="55"><a href="/en-us/docs/feature-list.html" target="_self" data-reactid="56">Feature list</a></li></ul></li><li style="height:324px;overflow:hidden;" class="menu-item menu-item-level-2" data-reactid="57"><span data-reactid="58"><!-- react-text: 59 -->Quick Start<!-- /react-text --><img style="transform:rotate(0deg);" class="menu-toggle" src="/img/arrow_down.png" data-reactid="60"/></span><ul data-reactid="61"><li class="menu-item menu-item-level-3" data-reactid="62"><a href="/en-us/docs/quick-start.html" target="_self" data-reactid="63">Nacos</a></li><li class="menu-item menu-item-level-3" data-reactid="64"><a href="/en-us/docs/quick-start-spring.html" target="_self" data-reactid="65">Nacos Spring</a></li><li class="menu-item menu-item-level-3" data-reactid="66"><a href="/en-us/docs/quick-start-spring-boot.html" target="_self" data-reactid="67">Nacos Spring Boot</a></li><li class="menu-item menu-item-level-3" data-reactid="68"><a href="/en-us/docs/quick-start-spring-cloud.html" target="_self" data-reactid="69">Nacos Spring Cloud</a></li><li class="menu-item menu-item-level-3" data-reactid="70"><a href="/en-us/docs/quick-start-docker.html" target="_self" data-reactid="71">Nacos Docker</a></li><li class="menu-item menu-item-level-3" data-reactid="72"><a href="/en-us/docs/use-nacos-with-dubbo.html" target="_self" data-reactid="73">Nacos with Dubbo</a></li><li class="menu-item menu-item-level-3" data-reactid="74"><a href="/en-us/docs/use-nacos-with-kubernetes.html" target="_self" data-reactid="75">Nacos with K8s</a></li><li class="menu-item menu-item-level-3" data-reactid="76"><a href="/en-us/docs/nacos-sync.html" target="_self" data-reactid="77">Nacos Sync</a></li></ul></li><li style="height:252px;overflow:hidden;" class="menu-item menu-item-level-2" data-reactid="78"><span data-reactid="79"><!-- react-text: 80 -->User Guide<!-- /react-text --><img style="transform:rotate(0deg);" class="menu-toggle" src="/img/arrow_down.png" data-reactid="81"/></span><ul data-reactid="82"><li class="menu-item menu-item-level-3" data-reactid="83"><a href="/en-us/docs/sdk.html" target="_self" data-reactid="84">Java SDK</a></li><li class="menu-item menu-item-level-3" data-reactid="85"><a href="/en-us/docs/other-language.html" target="_self" data-reactid="86">Other Language</a></li><li class="menu-item menu-item-level-3" data-reactid="87"><a href="/en-us/docs/open-api.html" target="_self" data-reactid="88">Open-API</a></li><li class="menu-item menu-item-level-3" data-reactid="89"><a href="/en-us/docs/nacos-spring.html" target="_self" data-reactid="90">Nacos Spring</a></li><li class="menu-item menu-item-level-3" data-reactid="91"><a href="/en-us/docs/system-configurations.html" target="_self" data-reactid="92">Nacos System Configurations</a></li><li class="menu-item menu-item-level-3" data-reactid="93"><a href="/en-us/docs/faq.html" target="_self" data-reactid="94">FAQ</a></li></ul></li><li style="height:36px;overflow:hidden;" class="menu-item menu-item-level-2" data-reactid="95"><span data-reactid="96"><!-- react-text: 97 -->Admin Guide<!-- /react-text --><img style="transform:rotate(-90deg);" class="menu-toggle" src="/img/arrow_down.png" data-reactid="98"/></span><ul data-reactid="99"><li class="menu-item menu-item-level-3" data-reactid="100"><a href="/en-us/docs/deployment.html" target="_self" data-reactid="101">Deployment Guide</a></li><li class="menu-item menu-item-level-3" data-reactid="102"><a href="/en-us/docs/cluster-mode-quick-start.html" target="_self" data-reactid="103">Cluster Mode Deployment</a></li><li class="menu-item menu-item-level-3" data-reactid="104"><a href="/en-us/docs/management-api.html" target="_self" data-reactid="105">Management OpenAPI</a></li><li class="menu-item menu-item-level-3" data-reactid="106"><a href="/en-us/docs/console-guide.html" target="_self" data-reactid="107">Admin Console Guide</a></li><li class="menu-item menu-item-level-3" data-reactid="108"><a href="/en-us/docs/monitor-guide.html" target="_self" data-reactid="109">Nacos Monitor Guide</a></li><li class="menu-item menu-item-level-3" data-reactid="110"><a href="/en-us/docs/nacos-config-benchmark.html" target="_self" data-reactid="111">Nacos Config Benchmark</a></li><li class="menu-item menu-item-level-3" data-reactid="112"><a href="/en-us/docs/nacos-naming-benchmark.html" target="_self" data-reactid="113">Nacos Naming Benchmark</a></li><li class="menu-item menu-item-level-3" data-reactid="114"><a href="/en-us/docs/nacos-sync-use.html" target="_self" data-reactid="115">Data Migration to Nacos</a></li></ul></li><li style="height:36px;overflow:hidden;" class="menu-item menu-item-level-2" data-reactid="116"><span data-reactid="117"><!-- react-text: 118 -->Contributor Guide<!-- /react-text --><img style="transform:rotate(-90deg);" class="menu-toggle" src="/img/arrow_down.png" data-reactid="119"/></span><ul data-reactid="120"><li class="menu-item menu-item-level-3" data-reactid="121"><a href="/en-us/docs/contributing.html" target="_self" data-reactid="122">Contribute to Nacos</a></li><li class="menu-item menu-item-level-3" data-reactid="123"><a href="/en-us/docs/contributing-flow.html" target="_self" data-reactid="124">Contributing Flow</a></li><li class="menu-item menu-item-level-3" data-reactid="125"><a href="/en-us/docs/pull-request.html" target="_self" data-reactid="126">Pull Request Template</a></li><li class="menu-item menu-item-level-3" data-reactid="127"><a href="/en-us/docs/how-to-reporting-bugs.html" target="_self" data-reactid="128">How to report bugs</a></li></ul></li><li style="height:36px;overflow:hidden;" class="menu-item menu-item-level-2" data-reactid="129"><span data-reactid="130"><!-- react-text: 131 -->Community<!-- /react-text --><img style="transform:rotate(-90deg);" class="menu-toggle" src="/img/arrow_down.png" data-reactid="132"/></span><ul data-reactid="133"><li class="menu-item menu-item-level-3" data-reactid="134"><a href="/en-us/docs/community.html" target="_self" data-reactid="135">Community</a></li><li class="menu-item menu-item-level-3" data-reactid="136"><a href="/en-us/docs/nacos-dev.html" target="_self" data-reactid="137">Develop Team</a></li></ul></li></ul></li></ul></div><div class="doc-content markdown-body" data-reactid="138"><h1>Cluster deployment instructions</h1>
<h2>Cluster Mode Deployment</h2>
<p>This Quick Start Manual is to help you quickly download, install and use Nacos on your computer to deploy the cluster mode for production use.</p>
<h3>Cluster Deployment Architecture</h3>
<p>Therefore, when it is open source, it is recommended that users put all server lists under a vip and then hang under a domain name.</p>
<p><a href="Http://ip1">Http://ip1</a>:port/openAPI Directly connected to ip mode, the machine needs to be modified to use ip.</p>
<p><a href="Http://VIP">Http://VIP</a>:port/openAPI Mount the VIP mode, directly connect to vip, the following server ip real ip, readability is not good.</p>
<p><a href="Http://nacos.com">Http://nacos.com</a>:port/openAPI Domain name + VIP mode, good readability, and easy to change ip, recommended mode</p>
<p><img src="https://cdn.nlark.com/yuque/0/2019/jpeg/338441/1561258986171-4ddec33c-a632-4ec3-bfff-7ef4ffc33fb9.jpeg" alt="deployDnsVipMode.jpg"></p>
<h2>1. Preparing for the Environment</h2>
<p>Make sure that it is installed and used in the environment:</p>
<ol>
<li>64 bit OS Linux/Unix/Mac, recommended Linux system.</li>
<li>64 bit JDK 1.8+; <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">Download</a>. <a href="https://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javome_t/">Configuration</a>.</li>
<li>Maven 3.2.x+; <a href="https://maven.apache.org/download.cgi">Download</a>. <a href="https://maven.apache.org/settings.html">Configuration</a>.</li>
<li>3 or more Nacos Nodes;</li>
</ol>
<h2>2. Download source code or installation package</h2>
<p>You can get Nacos in two ways.</p>
<h3>Download source code from Github</h3>
<pre><code class="language-bash">unzip nacos-source.zip
<span class="hljs-built_in">cd</span> nacos/
mvn -Prelease-nacos clean install -U  
<span class="hljs-built_in">cd</span> nacos/distribution/target/nacos-server-1.3.0/nacos/bin
</code></pre>
<h3>Download Compressed Packet after Compilation</h3>
<p>Download address</p>
<p><a href="https://github.com/alibaba/nacos/releases/download/1.3.0/nacos-server-1.3.0.zip">zip package</a></p>
<p><a href="https://github.com/alibaba/nacos/releases/download/1.3.0/nacos-server-1.3.0.tar.gz">tar.gz package</a></p>
<pre><code class="language-bash">  unzip nacos-server-1.3.0.zip or tar -xvf nacos-server-1.3.0.tar.gz
  <span class="hljs-built_in">cd</span> nacos/bin
</code></pre>
<h2>3. Configuration Cluster Profile</h2>
<p>In the Nacos decompression directory Nacos / conf directory, there is a configuration file cluster. conf, please configure each line as ip: port.</p>
<pre><code class="language-plain"># ip:port
200.8.9.16:8848
200.8.9.17:8848
200.8.9.18:8848
</code></pre>
<h2>4. Determine The DataSource</h2>
<h3>Using built-in data sources</h3>
<p>No configuration is required</p>
<h3>Use an external data source</h3>
<p><span data-type="color" style="color:rgb(25, 31, 37)"><span data-type="background" style="background-color:rgb(255, 255, 255)">production and use recommendations at least backup mode, or high availability database. </span></span></p>
<h4>Initializes the MySQL database</h4>
<p><a href="https://github.com/alibaba/nacos/blob/master/distribution/conf/nacos-mysql.sql">sql statement source file</a></p>
<h3>application. properties configuration</h3>
<p><a href="https://github.com/alibaba/nacos/blob/master/distribution/conf/application.properties">application.properties configuration file</a></p>
<h2>5. start server</h2>
<h3>Linux/Unix/Mac</h3>
<h4>Standalone mode</h4>
<pre><code class="language-bash">sh startup.sh -m standalone
</code></pre>
<h4>Cluster mode</h4>
<blockquote>
<p>Using built-in data sources</p>
</blockquote>
<pre><code class="language-bash">sh startup.sh -p embedded
</code></pre>
<blockquote>
<p>Use an external data source</p>
</blockquote>
<pre><code class="language-bash">sh startup.sh
</code></pre>
<h2>6. Service Registration &amp; Discovery and Configuration Management</h2>
<h3>Service registration</h3>
<p><code>curl -X PUT 'http://127.0.0.1:8848/nacos/v1/ns/instance?serviceName=nacos.naming.serviceName&amp;ip=20.18.7.10&amp;port=8080'</code></p>
<h3>Service discovery</h3>
<p><code>curl -X GET 'http://127.0.0.1:8848/nacos/v1/ns/instances?serviceName=nacos.naming.serviceName'</code></p>
<h3>Publish configuration</h3>
<p><code>curl -X POST &quot;http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&amp;group=test&amp;content=helloWorld&quot;</code></p>
<h3>get configuration</h3>
<p><code>curl -X GET &quot;http://127.0.0.1:8848/nacos/v1/cs/configs?dataId=nacos.cfg.dataId&amp;group=test&quot;</code></p>
<h2>7. shut down server</h2>
<h3>Linux/Unix/Mac</h3>
<pre><code class="language-bash">sh shutdown.sh
</code></pre>
</div></div></section><footer class="footer-container" data-reactid="139"><div class="footer-body" data-reactid="140"><img src="/img/nacos_gray.png" data-reactid="141"/><div class="cols-container" data-reactid="142"><div class="col col-12" data-reactid="143"><h3 data-reactid="144">Vision</h3><p data-reactid="145">By providing an easy-to-use service infrastructure such as dynamic service discovery, service configuration, service sharing and management and etc., Nacos help users better construct, deliver and manage their own service platform, reuse and composite business service faster and deliver value of business innovation more quickly so as to win market for users in the era of cloud native and in all cloud environments, such as private, mixed, or public clouds.</p></div><div class="col col-6" data-reactid="146"><dl data-reactid="147"><dt data-reactid="148">Documentation</dt><dd data-reactid="149"><a href="/en-us/docs/what-is-nacos.html" target="_self" data-reactid="150">Overview</a></dd><dd data-reactid="151"><a href="/en-us/docs/quick-start.html" target="_self" data-reactid="152">Quick start</a></dd><dd data-reactid="153"><a href="/en-us/docs/contributing.html" target="_self" data-reactid="154">Developer guide</a></dd></dl></div><div class="col col-6" data-reactid="155"><dl data-reactid="156"><dt data-reactid="157">Resources</dt><dd data-reactid="158"><a href="/en-us/community/index.html" target="_self" data-reactid="159">Community</a></dd><dd data-reactid="160"><a href="https://www.aliyun.com/product/acm?source_type=nacos_pc_20181219" target="_self" data-reactid="161">Cloud Service ACM</a></dd><dd data-reactid="162"><a href="https://www.aliyun.com/product/edas?source_type=nacos_pc_20181219" target="_self" data-reactid="163">Cloud Service EDAS</a></dd><dd data-reactid="164"><a href="https://www.aliyun.com/product/ahas?source_type=nacos_pc_20190225" target="_self" data-reactid="165">Cloud Service AHAS</a></dd></dl></div></div><div class="copyright" data-reactid="166"><span data-reactid="167">@ 2018 The Nacos Authors | An Alibaba Middleware (Aliware) Project</span></div></div></footer></div></div>
	<script src="https://f.alicdn.com/react/15.4.1/react-with-addons.min.js"></script>
	<script src="https://f.alicdn.com/react/15.4.1/react-dom.min.js"></script>
	<script>
		window.rootPath = '';
  </script>
	<script src="/build/documentation.js"></script>
</body>
</html>